<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
     <script>
         //concat 链接多个字符串
         //slice(start,end)从start开始截取 substring(start,end)同slice，不接受负值
         //substr
         var str = '改革春风吹满地';
         console.log(str.substr(2,2));

         //replace 替换字符
         var str1 = 'andy';
        console.log(str1.replace('a','b'));

        var str2 = 'oabcoefoxyozzopp';
        while(str2.indexOf('o') != -1){
            str2 = str2.replace('o','*');
        }
        console.log(str2);

         //spilt  分隔符
         var str3 = 'pink,blue,red,white';
         var arr = [];
         arr = str3.split(',');
         console.log(arr);
     </script>
</body> 
</html>